import Vue from 'vue'
import Vuex from 'vuex'

import home, { HomeState } from '@/store/modules/home'
import user, { UserState } from '@/store/modules/user'
import newApply, { NewApplyState } from '@/store/modules/newApply'
import appliedForMe, { AppliedForMeState } from '@/store/modules/appliedForMe'
import login, { LoginState } from '@/store/modules/login'
import recoverApply, { RecoverApplyState } from '@/store/modules/recoverApply'
import lossApply, { LossApplyState } from '@/store/modules/lossApply'
import revokeApply, { RevokeApplyState } from '@/store/modules/revokeApply'
import reissueApply, { ReissueApplyState } from '@/store/modules/reissueApply'
import applyPage, { ApplyPageState } from '@/store/modules/applyPage'
import myManagingSeal, {
  MyManagingSealState,
} from '@/store/modules/myManagingSeal'
import paymentOrder, { PaymentOrderState } from '@/store/modules/paymentOrder'
import homepage, { HomepageState } from '@/store/modules/homepage'
import project, { ProjectState } from '@/store/modules/project'

Vue.use(Vuex)

export interface RootState {
  home: HomeState
  user: UserState
  newApply: NewApplyState
  appliedForMe: AppliedForMeState
  login: LoginState
  recoverApply: RecoverApplyState
  revokeApply: RevokeApplyState
  lossApply: LossApplyState
  reissueApply: ReissueApplyState
  applyPage: ApplyPageState
  myManagingSeal: MyManagingSealState
  paymentOrder: PaymentOrderState
  homepage: HomepageState
  project: ProjectState
}

export interface ISealData {
  agentId: string
  agentLicenseNumber: string
  agentLicenseType?: number
  agentName: string
  agentMobile: string
  organizeAdministrationLevel?: number
  organizeLicenseNumber: string
  organizeLicenseType?: number
  organizeName: string
  organizeType?: number
  organizeUUID: string
  useType: number | null
  sealType: number | null
  sealName: string
  auditOrganizeName: string
  auditOrganizeLicenseType?: number
  auditOrganizeLicenseNumber: string
  fileKey: string
  url: string
  auditOrganizeUUID: string
  agentMobileDes: string
  agentLicenseNumberDes: string
  sealApplyId?: number
  area?: string
  reasonType: number
  reason: string
  reasonContent: string
  payType: number
  sealUseTime: number
  orderNo: string
  licenseNumberSource: number
  licenseNumberFileKey: string
  sealElectronicPicFileKey?: string
  sealElectronicPicSubmitType: number | null
}

export default new Vuex.Store({
  modules: {
    home,
    user,
    newApply,
    appliedForMe,
    login,
    revokeApply,
    recoverApply,
    lossApply,
    reissueApply,
    applyPage,
    myManagingSeal,
    paymentOrder,
    homepage,
    project,
  },
})
